package com.fastCms.manager.bim.controller.api;

import com.fastCms.business.bim.manage.DataRepairManageService;
import com.fastCms.business.bim.pojo.po.ClearCarBillPO;
import com.fastCms.business.bim.pojo.po.ClearCarBillRecordPO;
import com.fastCms.business.bim.pojo.vo.ClearCarBillDetailRecordVO;
import com.fastCms.business.bim.pojo.vo.ClearCarBillDetailVO;
import com.fastCms.business.bim.pojo.vo.ClearCarBillVO;
import com.fastCms.business.frame.pojo.PageParam;
import com.fastCms.business.frame.response.ApiResponse;
import com.fastCms.business.frame.response.ResponseUtil;
import com.fastCms.manager.frame.annotation.UserAccess;
import com.github.pagehelper.PageInfo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 * 治理设备-数据 前端控制器
 * </p>
 *
 * @author liusq
 * @since 2021-07-05
 */
@RequestMapping("api/dataRepair")
@RestController
@Api(value = "ApiDataRepairController", tags = "前端-治理设备")
@UserAccess
public class ApiDataRepairController {


    @Autowired
    private DataRepairManageService dataRepairManageServiceImpl;

    @ApiOperation(value = "清洁车台账", notes = "")
    @PostMapping("/clearCarBill")
    public ApiResponse<PageInfo<ClearCarBillVO>> clearCarBill(@RequestBody PageParam<ClearCarBillPO> pageParam) {
        PageInfo<ClearCarBillVO> result = dataRepairManageServiceImpl.clearCarBill(pageParam);
        return ResponseUtil.success(result);
    }


    @ApiOperation(value = "清洁车台账-查看详情之顶部概述", notes = "")
    @GetMapping("/clearCarBillDetail/{deviceId}")
    public ApiResponse<ClearCarBillDetailVO> clearCarBillDetail(@PathVariable Integer deviceId) {
        ApiResponse<ClearCarBillDetailVO> result = dataRepairManageServiceImpl.clearCarBillDetail(deviceId);
        return result;
    }

    @ApiOperation(value = "清洁车台账-查看详情之表单", notes = "传设备ID")
    @PostMapping("/clearCarBillDetailRecord")
    public ApiResponse<PageInfo<ClearCarBillDetailRecordVO>> clearCarBillDetailRecord(@RequestBody PageParam<ClearCarBillRecordPO> pageParam) {
        ApiResponse<PageInfo<ClearCarBillDetailRecordVO>> result = dataRepairManageServiceImpl.clearCarBillDetailRecord(pageParam);
        return result;
    }

}

